<?php
/*
	
*/
defined('BY_JYA') or exit('Access Denied');
global $_RQ,$_AR;

$_RQ['op']=$_RQ['op']?$_RQ['op']:'post';
$return=array();
$return['diy']=$this->plugin_setting('diy');
if($_RQ['op']=='post'){
	$postdata=get_postdata();
	$formid = 'id'.$postdata['pageid'].'i'.$postdata['index'];
	$msglog = pdo_get('jy_gohome_data',array('uniacid'=>$_SESSION['uniacid'],'user_id'=>$_SESSION['uid'],'formid'=>$formid));
	if(!empty($msglog)){
		$return['error'] =1;
		$return['message'] = '您已经提交过了！';
		exi($return);
	}
	if($postdata['fileddata']){
		$data=array(
					'uniacid'=>$_SESSION['uniacid'],
					'user_id'=>$_SESSION['uid'],
					'data'=>ijson_encode($postdata['fileddata']),
					'createtime'=>TIMESTAMP,
					'formid'=>$formid,
		);
		pdo_insert('jy_gohome_data',$data);
		exi('提交成功');
	}else{
		$return['error'] =1;
		$return['message'] = '提交数据为空！';
		exi($return);
	}
}
